/*
 * Project: Sudoku Hint Engine for Android
 * Copyright (C) 2010-2013 Emanuel Moecklin
 * 
 * Available under the terms of the Lesser General Public License (LGPL)
 */
package com.onegravity.sudoku.solver.checks;

import com.onegravity.sudoku.solver.accumulator.HintsAccumulator;
import com.onegravity.sudoku.solver.accumulator.StopHintProductionException;
import com.onegravity.sudoku.solver.data.Grid;

/**
 * This class checks if some pencil marks can be eliminated because the same value already exists
 * in a neighboring row, column, block or extra region
 * @author Emanuel Moecklin
 */
public class PencilMarks2EliminateProducer extends PencilMarksHintsProducer {

	public PencilMarks2EliminateProducer(Grid solvedGrid) {
		super(solvedGrid);
	}
	
	@Override
	public void getHints(Grid grid, HintsAccumulator accu) throws StopHintProductionException {
		if (!processGrid(grid) && mToBeRemoved.size()>0) {
			PencilMarks2EliminateHint message = new PencilMarks2EliminateHint(mToBeRemoved);
            accu.add(message);
		}
    }

}